<?php
class DB
{
	const DB_HOST = '127.0.0.1';
	//const DB_HOST = '46.36.217.66';
	const DB_NAME = 'raybt_b';
	const DB_USER = 'raybt_u';
	const DB_PSWD = '4biR1zkW$s';

	private static $db;

	public static function conn()
	{
		$opts     = array(
			PDO::ATTR_PERSISTENT         => true, // use existing connection if exists, otherwise try to connect
			PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC // by default fetch results as associative array
		);
		self::$db = new PDO( sprintf( "mysql:host=%s;dbname=%s;charset=utf8", self::DB_HOST, self::DB_NAME ), self::DB_USER, self::DB_PSWD, $opts );
		return self::$db;
	}
}
